import javax.microedition.midlet.*;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Display;

public class SpaceRacer extends MIDlet {
    boolean isInited;
    public GameScreen gs;

    public SpaceRacer() {
        isInited = false;
        gs = new GameScreen(this);
        gs.init();
    }

    public void startApp() {
        Displayable currentDisplay = Display.getDisplay(this).getCurrent();
        if (currentDisplay == null) {
            gs.startUp();
        }
        else {
            Display.getDisplay(this).setCurrent(currentDisplay);
        }
    }

    public void pauseApp(){
    }

    public void destroyApp(boolean unconditional) {
        if (gs != null) gs.stop();
        gs = null;
    }

    public void exitRequested() {
        destroyApp(true);
        notifyDestroyed();
    }
}
